class FileWriteDemo
	{
	public static boolean writeSomething(File f1, String data)
		{
		FileWriter fw = null;
		try
			{
			fw = new FileWriter(f1);
			if(f1.canRead())
				f1.write(data);
			else
				{
				f1.createNewFile();
				f1.write(data);
				}
			}
		catch(IOException ioe)
			{
			System.out.println("Error occurred during file opening or writing : " + ); 
			}
		finally
			{
			try
				{
				fw.flush();
				fw.close();
				}
			catch(IOException e)	
				{
				e.printStackTrace();
				}
			}
		return true;
		}
	
	public static void main(String args[])
		{
		
		}
	}